{include file="public/header" /}

<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{:lang('admin list')}</h5>
                    <div class="ibox-tools">
                        <button type="button" class="btn btn-primary btn-xs"
                                onclick="addAdmin()">{:lang('add')}
                        </button>
                        <button type="button" class="btn btn-danger btn-xs"
                                onclick="delRecords(0,'admin')">{:lang('delete')}
                        </button>
                    </div>
                </div>

                <div class="ibox-content">

                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>
                                    <input id="checkAll" type="checkbox">
                                </th>
                                <th>{:lang('number')}</th>
                                <th>{:lang('admin name')}</th>
                                <th>{:lang('admin role')}</th>
                                <th>{:lang('admin phone')}</th>
                                <th>{:lang('admin email')}</th>
                                <th>{:lang('insert time')}</th>
                                <th>{:lang('operation')}</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="v" key="k"}
                            <tr>
                                <td>
                                    <input id="{$v.id}" type="checkbox" class="inputCheckBox">
                                </td>
                                <td>
                                    {$k}
                                </td>
                                <td>{$v.adminName}</td>
                                <td>{$v.roleName|default='超级管理员'}</td>
                                <td>{$v.adminPhone|default='暂无'}</td>
                                <td>{$v.adminEmail|default='暂无'}</td>
                                <td>{$v.addTime|date='Y-m-d H:i',###}</td>
                                <td>
                                    <button type="button" class="btn btn-primary btn-xs" onclick="editAdmin('{$v.id}')">
                                        {:lang('edit')}
                                    </button>
                                    <button type="button" class="btn btn-danger btn-xs"
                                            onclick="delRecords('{$v.id}','admin')">{:lang('delete')}
                                    </button>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>

{include file="public/footer" /}
<script>
    function editAdmin(adminID) {
        layer.open({
            type: 2,
            title: '{:lang("admin edit")}',
            skin: 'layui-layer-rim', //加上边框
            area: ['80%', '80%'], //宽高
            shadeClose: true, //开启遮罩关闭
            content: '/Admin/Admin/editAdmin?adminID=' + adminID
        });
    }

    function addAdmin() {
        layer.open({
            type: 2,
            title: '{:lang("admin add")}',
            skin: 'layui-layer-rim', //加上边框
            area: ['80%', '80%'], //宽高
            shadeClose: true, //开启遮罩关闭
            content: '/Admin/Admin/addAdmin'
        });
    }
</script>